<template>
	<view  class="setting">
		<view class="message">
			<u-cell-group :border="false">
				<u-cell
				size="large"
				title="我的信息"
				titleStyle="font-weight:550;"
				value="个人/企业信息"
				label="  "
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				title="青少年守护"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				>	
				</u-cell>
			</u-cell-group>
		</view>
		<view class="common">
			<u-cell-group :border="false">
				<u-cell
				size="large"
				title="通用"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				title="新消息通知"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				title="外观与布局"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				>	
				</u-cell>
			</u-cell-group>
		</view>
		<view class="security-center">
			<u-cell-group :border="false">
				<u-cell
				size="large"
				title="安全中心"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				>
					<view
					    slot="value"
					> <uni-icons type="locked-filled" size="25"></uni-icons>已保护</view>
				</u-cell>
			</u-cell-group>
		</view>
		<view class="text">
			隐私
		</view>
		<view class="privacy">
			<u-cell-group :border="false">
				<u-cell
				size="large"
				title="好友权限"
				titleStyle="font-weight:550;"
				label="加好友权限、加群权限、黑名单"
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				titleStyle="font-weight:550;"
				title="对外信息权限"
				label="企业名称信息、日程信息、登录信息"
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				titleStyle="font-weight:550;"
				title="系统及应用权限"
				label="系统权限、应用授权、内容权限"
				isLink
				>	
				</u-cell>
				<u-cell
				size="large"
				titleStyle="font-weight:550;"
				title="个人信息查询与下载"
				label="  "
				isLink
				>
				</u-cell>
				<u-cell
				size="large"
				titleStyle="font-weight:550;"
				title="共享个人信息清单"
				label="  "
				isLink=""
				></u-cell>
			</u-cell-group>		
		</view>
		
		<view class="version">
			<u-cell-group :border="false">
				<u-cell
				size="large"
				title="帮助与反馈"
				titleStyle="font-weight:550;"
				label=" "
				isLink
				></u-cell>
				<u-cell
				size="large"
				title="关于钉校园"
				titleStyle="font-weight:550;"
				value="版本1.0.1"
				isLink
				>
				</u-cell>
			</u-cell-group>
		</view>
		
		<view class="switch-account">
			<button  hover-class="hover">切换账号</button>
		</view>
		
		<view class="exit">
			<button hover-class="hover" @click="logout()">退出登录</button>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token:'',
				toast:{
					type:'default',
					title:'默认主题',
					message:'退出成功',
				}
			}
		},
		onLoad() {
			let _this = this;
			uni.getStorage({
				key:"token",
				success(res) {
					_this.token = res.data;
				}
			})
		},
		methods: {
			showToast(params) {
			this.$refs.uToast.show({
				...params,
				complete(){
					uni.navigateTo({
						url:'/pages/login/login'
					})
				}
			})
			},
			logout(){
			    let	_this = this;
				uni.request({
					url:"http://localhost:8090/nailCampus/index/logout",
					header:{
						"token":_this.token
					},
					success() {
						uni.clearStorage();
						_this.showToast(_this.toast);
					}
				})
			}
		}
	}
</script>

<style lang="less" >
	.setting{
		height: 100%;
		background-color: #F1F1F3;
		padding-top: 2%;
		padding-bottom: 10%;
		.message{
			background-color: #FFFFFF;
		}
		.common{
			margin-top: 2%;
			background-color: #FFFFFF;
		}
		.security-center{
			margin-top: 2%;
			background-color: #FFFFFF;
		}
		.text{
			color: #969696;
			margin-left: 2%;
			margin-top: 5%;
		}
		.privacy{
			margin-top: 2%;
			background-color: #FFFFFF;
		}
		.version{
			margin-top: 2%;
			background-color: #FFFFFF;
		}
		.switch-account{
			background-color: #FFFFFF;
			margin-top: 2%;
			button{
				background-color: #FFFFFF;
				font-weight: 550;
			}
			button::after{
				border:none;
			}
			.hover{
				background-color: #e7e7e7;
			}
		}
		.exit{
			margin-top: 2%;
			button{
				background-color: #FFFFFF;
				font-weight: 550;
			}
			button::after{
				border:none;
			}
			.hover{
				background-color: #e7e7e7;
			}
		}
	}
</style>
